***Lucid Survey
***Fielded 4/2/21 - 4/8/21

*Use data file: LucidRepData.dta

******Demographics
*Note: tables for these recoded variables are the basis for the corresponding sample demographic information Appendix Table 1 and sample information in the Supplemental Materials


***Partisanship
*Q85 Generally speaking, do you think of yourself as a Republican, Democrat, Independent, or what?
*Republican  (1) 
*Democrat  (2) 
*Independent  (3) 
*Other party (specify)  (4)
tab Q85
*Q86 Would you call yourself a strong Democrat or not a very strong Democrat?
*Strong  (1) 
*Not very strong  (2) 
tab Q86
*Q87 Would you call yourself a strong Republican or not a very strong Republican?
*Strong  (1) 
*Not very strong  (2) 
tab Q87
*Q88 Do you think of yourself as closer to the Republican Party or the Democratic Party?
*Closer to Republican  (1) 
*Neither  (2) 
*Closer to Democratic  (3) 
tab Q88

*Dichotomous. 0 Dem, 1 Rep
gen party2=.
replace party2=0 if Q85==2
replace party2=0 if Q88==3
replace party2=1 if Q85==1
replace party2=1 if Q88==1
tab party2
label define party2 0 "Democrat" 1 "Republican"
label values party2 party2
tab party2

*7 point party id
gen party7=.
replace party7=1 if Q86==1
replace party7=2 if Q86==2
replace party7=3 if Q88==3
replace party7=4 if Q88==2
replace party7=5 if Q88==1
replace party7=6 if Q87==2
replace party7=7 if Q87==1
tab party7

*3 category party
gen party3=.
replace party3=0 if party7==1
replace party3=0 if party7==2
replace party3=0 if party7==3
replace party3=1 if party7==4
replace party3=2 if party7==5
replace party3=2 if party7==6
replace party3=2 if party7==7
tab party3
label define party3 0 "Democrat" 1 "Independent" 2 "Republican"
label values party3 party3
tab party3


***Gender
*Q92 What do you identify as your gender?
*Male  (1) 
*Female  (2) 
*Other  (3) ________________________________________________
*Prefer not to answer  (4) 
tab Q92

gen gender3=.
replace gender3=1 if Q92==1
replace gender3=2 if Q92==2
replace gender3=3 if Q92==3
replace gender3=3 if Q92==4
tab gender3
label define gender3 1 "Male" 2 "Female" 3"Other"
label values gender3 gender3
tab gender3

gen gender2=gender3
replace gender2=. if gender3==3
tab gender2
label define gender2 1 "Male" 2 "Female"
label values gender2 gender2
tab gender2

***Race and ethnicity
*Q90 Are you Spanish, Hispanic, or Latino or none of these?
*Yes  (1) 
*None of these  (0) 
tab Q90

*Q91 What do you identify as your race/ethnicity? Check all that apply. 
*American Indian or Alaskan Native  (1) 
*Asian or Pacific Islander  (2) 
*Black or African American  (3) 
*White/Caucasian  (4) 
*Other (please specify)  (5) ________________________________________________
*Prefer not to answer  (6) 
tab Q91

gen race3=.
replace race3=0 if Q90==0 & Q91=="4"
replace race3=1 if Q90==0 & Q91=="3"
replace race3=2 if Q90==1 & Q91=="4"
replace race3=2 if Q90==1 & Q91=="3"
replace race3=2 if Q91=="1"
replace race3=2 if Q91=="1,2"
replace race3=2 if Q91=="1,2,3,4"
replace race3=2 if Q91=="1,3"
replace race3=2 if Q91=="1,4"
replace race3=2 if Q91=="2"
replace race3=2 if Q91=="2,4"
replace race3=2 if Q91=="3,4"
replace race3=2 if Q91=="4,5"
replace race3=2 if Q91=="4,6"
replace race3=2 if Q91=="5"
replace race3=. if Q91=="6"
tab race3

tab race3
label define race3 0 "White" 1 "Black" 2 "Other"
label values race3 race3
tab race3

***Education
*Q93 What is the highest level of education you have completed?
tab Q93
gen edu=Q93
tab edu
tabstat edu, stats (p50)

***Age
*Q94 What is your age?
tab Q94
gen newage=Q94
replace newage=. if Q94==999
tab newage
mean newage

***Ideology
*Q89 Where would you place yourself on the following scale regarding your political views?
tab Q89
gen ideo=Q89
tab ideo

***Income
*Q95 What is your estimate of your annual household income (before taxes)?
tab Q95
gen income=Q95
tab income
tabstat income, stats (p50)

***Authoritarianism
*Q100 Please tell us which one you think is more important for a child to have: independence or respect for elders?
*Independence  (1) 
*Respect for elders  (2) 
tab Q100
gen auth1=.
replace auth1=0 if Q100==1
replace auth1=1 if Q100==2
tab auth1

*Q101 Please tell us which one you think is more important for a child to have: obedience or self reliance? 
*Obedience  (1) 
*Self reliance  (2) 
tab Q101
gen auth2=.
replace auth2=0 if Q101==2
replace auth2=1 if Q101==1
tab auth2

*Q102 Please tell us which one you think is more important for a child to have: curiosity or good manners? 
*Curiosity  (1) 
*Good manners  (2) 
tab Q102
gen auth3=.
replace auth3=0 if Q102==1
replace auth3=1 if Q102==2
tab auth3

*Q103 Please tell us which one you think is more important for a child to have: being considerate or well behaved? 
*Considerate  (1) 
*Well behaved  (2) 
tab Q103
gen auth4=.
replace auth4=0 if Q103==1
replace auth4=1 if Q103==2
tab auth4

gen auth= auth1+auth2+auth3+auth4
tab auth

*Worry about victimization
*Q99 How worried are you about being the victim of a crime? 1=not worried at all, 7=extremely worried
tab Q99
gen worry=Q99
tab worry

***WN threat
*Q112 How serious of a threat is White Nationalism to the United States?
tab Q112
gen WNthreat=Q112
tab WNthreat

***IF threat
*Q113 How serious of a threat is Islamic Fundamentalism to the United States?
tab Q113
gen IFthreat=Q113
tab IFthreat

*Threat question order
tab Threat_Qs_DO
gen threatorder=.
replace threatorder=0 if Threat_Qs_DO=="Q112|Q113|Q124"
replace threatorder=1 if Threat_Qs_DO=="Q113|Q112|Q124"
tab threatorder


*Racial resentment. 1 strongly disagree, 7 strongly agree
*Q106_1 Irish, Italian, Jewish, and many other minority groups overcame prejudice and worked their way up. Black people should do the same without any special favors. 
*Q106_2 Generations of slavery and discrimination have created conditions that make it difficult for Black people to work their way out of the lower class 
*Q106_3 Over the past few years, Black people have gotten less than they deserve 
*Q106_4 It’s really only a matter of some people not trying hard enough; if Black people would only try harder they could be just as well-off as whites 
tab Q106_1
gen resent1=Q106_1
tab resent1

tab Q106_2
gen resent2=8-Q106_2
tab resent2

tab Q106_3
gen resent3=8-Q106_3
tab resent3

tab Q106_4
gen resent4=Q106_4
tab resent4

gen resent=(resent1+resent2+resent3+resent4)/4
tab resent


*****Terrorism

*Experimental condition
tab TerrorGroup
gen terror=.
replace terror=0 if TerrorGroup=="Terr_Control"
replace terror=1 if TerrorGroup=="Terr_IF"
replace terror=2 if TerrorGroup=="Terr_WN"
tab terror
label define terror 0 "Control" 1 "Islamic Fundamentalist" 2 "White Nationalist"
label values terror terror
tab terror



*Predicting threat perceptions
tab WNthreat party2 if(terror==0), column
tab IFthreat party2 if(terror==0), column

ologit WNthreat i.party2 i.gender2 i.race3 edu newage income i.threatorder i.terror if(terror==0), robust
*outreg2 using ThreatModels.doc, replace ctitle(WN Threat Con) label 
ologit WNthreat i.party2 i.gender2 i.race3 edu newage income i.threatorder i.terror, robust
*outreg2 using ThreatModels.doc, append ctitle(WN Threat Full) label 

ologit IFthreat i.party2 i.gender2 i.race3 edu newage income i.threatorder i.terror if(terror==0), robust
*outreg2 using ThreatModels.doc, append ctitle(IF Threat Con) label 
ologit IFthreat i.party2 i.gender2 i.race3 edu newage income i.threatorder i.terror, robust
*outreg2 using ThreatModels.doc, append ctitle(IF Threat Full) label 




*Speech
*Q35 Should people suspected of terrorist involvement be banned from making public speeches?
*Q40 Should White Nationalists suspected of terrorist involvement be banned from making public speeches?
*Q45 Should Islamic Fundamentalists suspected of terrorist involvement be banned from making public speeches?
*1= yes
*0= no
tab Q35
tab Q40
tab Q45

gen speech=.
replace speech=1 if Q35==1
replace speech=1 if Q40==1
replace speech=1 if Q45==1
replace speech=0 if Q35==0
replace speech=0 if Q40==0
replace speech=0 if Q45==0
tab speech
tab speech
label define speech 0 "No" 1 "Yes"
label values speech speech
tab speech

**Info for Table 5
*Dem
tab speech terror if(party2==0), col
prtest speech if(terror==0 & party2==0 | terror==1 & party2==0), by(terror)
prtest speech if(terror==0 & party2==0 | terror==2 & party2==0), by(terror)
*Rep
tab speech terror if(party2==1), col
prtest speech if(terror==0 & party2==1 | terror==1 & party2==1), by(terror)
prtest speech if(terror==0 & party2==1 | terror==2 & party2==1), by(terror)
*Full Model for Supplementals
logit speech i.terror i.party2 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party2, robust
*outreg2 using ModelsDi.doc, replace ctitle(Ban Speech) label 
margins, dydx(i.terror) at(party2=(0 1)) vsquish
marginsplot, scheme(s1mono)  xlab(-.25 " " 0 "Democrat" 1 "Republican" 1.25 " ", ) title("Effect on Probability of Support for Banning Speech (Lucid)") yline(0,lpattern(dot))  xtitle("Partisanship", margin(medium)) ytitle("Effect on Probability of Support", margin(medium)) plot(,label("Islamic Fundamentalist" "White Nationalist"))
*graph export SpeechParty.pdf, replace
*Predicted Probabilities for Table 5
margins i.terror, at(party2=(0 1)) vsquish


*Monitor
*Q32 If a person is suspected of being a terrorist, should the government be allowed to monitor their phone calls without obtaining a warrant?
*Q37 If a person is suspected of being a White Nationalist terrorist, should the government be allowed to monitor their phone calls without obtaining a warrant?
*Q42 If a person is suspected of being an Islamic Fundamentalist terrorist, should the government be allowed to monitor their phone calls without obtaining a warrant?
*1= yes
*0= no
tab Q32
tab Q37
tab Q42

gen monitor=.
replace monitor=1 if Q32==1
replace monitor=1 if Q37==1
replace monitor=1 if Q42==1
replace monitor=0 if Q32==0
replace monitor=0 if Q37==0
replace monitor=0 if Q42==0
tab monitor
tab monitor
label define monitor 0 "No" 1 "Yes"
label values monitor monitor
tab monitor

**Info for Table 5
*Dem
tab monitor terror if(party2==0), col
prtest monitor if(terror==0 & party2==0 | terror==1 & party2==0), by(terror)
prtest monitor if(terror==0 & party2==0 | terror==2 & party2==0), by(terror)
*Rep
tab monitor terror if(party2==1), col
prtest monitor if(terror==0 & party2==1 | terror==1 & party2==1), by(terror)
prtest monitor if(terror==0 & party2==1 | terror==2 & party2==1), by(terror)
*Full Model for Supplementals
logit monitor i.terror i.party2 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party2, robust
*outreg2 using ModelsDi.doc, append ctitle(Monitor) label 
margins, dydx(i.terror) at(party2=(0 1)) vsquish
marginsplot, scheme(s1mono)  xlab(-.25 " " 0 "Democrat" 1 "Republican" 1.25 " ", ) title("Effect on Probability of Support for Monitoring Phone (Lucid)") yline(0,lpattern(dot))  xtitle("Partisanship", margin(medium)) ytitle("Effect on Probability of Support", margin(medium)) plot(,label("Islamic Fundamentalist" "White Nationalist"))
*graph export MonitorParty.pdf, replace
*Predicted Probabilities for Table 5
margins i.terror, at(party2=(0 1)) vsquish


*Social Media
*Q33 Should the government shut down social media accounts belonging to someone suspected of being a terrorist?
*Q38 Should the government shut down social media accounts belonging to someone suspected of being a White Nationalist terrorist?
*Q43 Should the government shut down social media accounts belonging to someone suspected of being an Islamic Fundamentalist terrorist?
*1= yes
*0= no
tab Q33
tab Q38
tab Q43

gen socialmed=.
replace socialmed=1 if Q33==1
replace socialmed=1 if Q38==1
replace socialmed=1 if Q43==1
replace socialmed=0 if Q33==0
replace socialmed=0 if Q38==0
replace socialmed=0 if Q43==0
tab socialmed
tab socialmed
label define socialmed 0 "No" 1 "Yes"
label values socialmed socialmed
tab socialmed

**Info for Table 5
*Dem
tab socialmed terror if(party2==0), col
prtest socialmed if(terror==0 & party2==0 | terror==1 & party2==0), by(terror)
prtest socialmed if(terror==0 & party2==0 | terror==2 & party2==0), by(terror)
*Rep
tab socialmed terror if(party2==1), col
prtest socialmed if(terror==0 & party2==1 | terror==1 & party2==1), by(terror)
prtest socialmed if(terror==0 & party2==1 | terror==2 & party2==1), by(terror)
*Full Model for Supplementals
logit socialmed i.terror i.party2 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party2, robust
*outreg2 using ModelsDi.doc, append ctitle(Social Media) label 
margins, dydx(i.terror) at(party2=(0 1)) vsquish
marginsplot, scheme(s1mono)  xlab(-.25 " " 0 "Democrat" 1 "Republican" 1.25 " ", ) title("Effect on Prob. of Support for Shutting Down Social Media (Lucid)") yline(0,lpattern(dot))  xtitle("Partisanship", margin(medium)) ytitle("Effect on Probability of Support", margin(medium)) plot(,label("Islamic Fundamentalist" "White Nationalist"))
*graph export MediaParty.pdf, replace
*Predicted Probabilities for Table 5
margins i.terror, at(party2=(0 1)) vsquish


*Hold
*Q34 Should the government be allowed to hold a person suspected of plotting a terror attack for an unlimited amount of time?
*Q39 Should the government be allowed to hold a White Nationalist suspected of plotting a terror attack for an unlimited amount of time?
*Q44 Should the government be allowed to hold an Islamic Fundamentalist suspected of plotting a terror attack for an unlimited amount of time?
*1= yes
*0= no
tab Q34
tab Q39
tab Q44

gen hold=.
replace hold=1 if Q34==1
replace hold=1 if Q39==1
replace hold=1 if Q44==1
replace hold=0 if Q34==0
replace hold=0 if Q39==0
replace hold=0 if Q44==0
tab hold
tab hold
label define hold 0 "No" 1 "Yes"
label values hold hold
tab hold

**Info for Table 5
*Dem
tab hold terror if(party2==0), col
prtest hold if(terror==0 & party2==0 | terror==1 & party2==0), by(terror)
prtest hold if(terror==0 & party2==0 | terror==2 & party2==0), by(terror)
*Rep
tab hold terror if(party2==1), col
prtest hold if(terror==0 & party2==1 | terror==1 & party2==1), by(terror)
prtest hold if(terror==0 & party2==1 | terror==2 & party2==1), by(terror)
*Full Model for Supplementals
logit hold i.terror i.party2 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party2, robust
*outreg2 using ModelsDi.doc, append ctitle(hold) label 
margins, dydx(i.terror) at(party2=(0 1)) vsquish
marginsplot, scheme(s1mono)  xlab(-.25 " " 0 "Democrat" 1 "Republican" 1.25 " ", ) title("Effect on Prob. of Support for Holding Indefinitely (Lucid)") yline(0,lpattern(dot))  xtitle("Partisanship", margin(medium)) ytitle("Effect on Probability of Support", margin(medium)) plot(,label("Islamic Fundamentalist" "White Nationalist"))
*graph export HoldParty.pdf, replace
*Predicted Probabilities for Table 5
margins i.terror, at(party2=(0 1)) vsquish


***** 4 item index
tab speech
tab monitor
tab socialmed
tab hold

gen addindex= speech + monitor + socialmed + hold
tab addindex

gen avgindex= addindex/4
tab avgindex
**Info for Table 5
*Dem
tabstat avgindex if(party2==0), by(terror) stats(mean sem n)
ttest avgindex if(terror==0 & party2==0 | terror==1 & party2==0), by(terror)
ttest avgindex  if(terror==0 & party2==0 | terror==2 & party2==0), by(terror)
*Rep
tabstat avgindex if(party2==1), by(terror) stats(mean sem n)
ttest avgindex if(terror==0 & party2==1 | terror==1 & party2==1), by(terror)
ttest avgindex  if(terror==0 & party2==1 | terror==2 & party2==1), by(terror)
*Full Model for Table 2 and for Supplementals
regress avgindex i.terror i.party2 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party2, robust
*outreg2 using ModelsDi.doc, append ctitle(Index) label 
*Figure 4
margins, dydx(i.terror) at(party2=(0 1)) vsquish
marginsplot, scheme(s1mono)  xlab(-.25 " " 0 "Democrat" 1 "Republican" 1.25 " ", ) title("Effect on Support for Restrictions (Index, Lucid)") yline(0,lpattern(dot))  xtitle("Partisanship", margin(medium)) ytitle("Effect on Support for Restrictions", margin(medium)) plot(,label("Islamic Fundamentalist" "White Nationalist"))
*graph export AverageIndex.pdf, replace

margins i.terror, at(party2=(0 1)) vsquish



**************************************
*Analyses for Supplemental Materials**
**************************************

*Models with no controls (still interacting party and treatment)
logit speech i.terror i.party2 i.terror##i.party2, robust
*outreg2 using NoControlModels.doc, replace ctitle(Ban Speech) label
logit monitor i.terror i.party2  i.terror##i.party2
*outreg2 using NoControlModels.doc, append ctitle(Monitor) label
logit socialmed i.terror i.party2  i.terror##i.party2
*outreg2 using NoControlModels.doc, append ctitle(Social Media) label
logit hold i.terror i.party2  i.terror##i.party2
*outreg2 using NoControlModels.doc, append ctitle(Hold) label
regress avgindex i.terror i.party2  i.terror##i.party2, robust
*outreg2 using NoControlModels.doc, append ctitle(Index) label

*Full Models (with controls) with partisanship as 3 categories: Democrat, “Pure” Independent, Republican.
logit speech i.terror i.party3 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party3, robust
*outreg2 using ModelsParty3.doc, replace ctitle(Ban Speech) label 
logit monitor i.terror i.party3 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party3, robust
*outreg2 using ModelsParty3.doc, append ctitle(Monitor) label 
logit socialmed i.terror i.party3 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party3, robust
*outreg2 using ModelsParty3.doc, append ctitle(SocialMedia) label 
logit hold i.terror i.party3 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party3, robust
*outreg2 using ModelsParty3.doc, append ctitle(Hold) label 
regress avgindex i.terror i.party3 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party3, robust
*outreg2 using ModelsParty3.doc, append ctitle(Index) label


*Models with no controls or interactions for party; just average treatment effects
logit speech i.terror, robust
*outreg2 using ATEModels.doc, replace ctitle(Ban Speech) label
logit monitor i.terror, robust
*outreg2 using ATEModels.doc, append ctitle(Monitor) label 
logit socialmed i.terror, robust
*outreg2 using ATEModels.doc, append ctitle(Social Media) label 
logit hold i.terror, robust
*outreg2 using ATEModels.doc, append ctitle(Hold) label
regress avgindex i.terror, robust
*outreg2 using ATEModels.doc, append ctitle(Index) label

***Models to be corrected for multiple group comparisons
regress avgindex i.terror i.party2  i.terror##i.party2, robust pformat(%5.4f) 
regress avgindex i.terror i.party2 i.gender2 i.race3 edu newage income auth worry resent WNthreat IFthreat i.terror##i.party2, robust pformat(%5.4f) 





